package com.sss.hloster0503;
/**
 * 线程等待和中断等待
 * @author 茶楼
 *
 */
public class CountThread extends Thread {
	private int i = 0;

	public CountThread() {
		super(" 计数线程  ");
	}
	public void run() {
		while (i < 10) {
			try {
				System.out.println(this.getName() + "计数：：" + (i + 1));
				i++;
				Thread.sleep(5000);
			} catch (InterruptedException e) {
				System.out.println("程序捕获了  InteruptedException  异常！！");
			}
			System.out.println("计数线程运行 1 次。");
		}
	}

}
